package cn.xiaoliu.hrm.feign;

import cn.xiaoliu.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserInfoFallbackFactory implements FallbackFactory<UserInfoFeignClients>{
    @Override
    public UserInfoFeignClients create(Throwable throwable) {
        return new UserInfoFeignClients() {
            @Override
            public AjaxResult findUserInfo(Long id) {
                return AjaxResult.me().setSuccess(false).setMessage("操作失败");
            }
        };
    }
}
